function teacherType() {
	//非讲师隐藏
	if(user_status == '2'){
		//我的主页
		$(".my_page").hide();
		
		//头像飘带
		$(".sliver").hide();
	}
}
/*
基本信息
 */
function personInfo(){
	$.get(
		API_URL+"agent/getbyopenid?openid="+openid,
		function(Obj){
			var myData = Obj.data[0];
			//姓名&级别
			if(user_status=='2'){
				$(".per_detial h3").html(myData.name);
			}else{
				$(".per_detial h3").html(myData.name+'<span class="first_gear">'+myData.agent_level+'</span>');
			}
			//头像
			if(myData.icon == null || myData.icon == ''){
				myData.icon ='../img/default.png';
			}
			$(".teacher_icon").attr("src",myData.icon);
			//区分明星和品牌讲师
			if(myData.agent_category == 2){
				$(".per_detial div span.sliver").css({
					'background': 'url(../img/binpai.png)',
					'background-size': '100% 100%'
				});
				
				//级别
				$(".per_detial h3 span.first_gear").css({
					'background': '#FFD900',
					'color': '#A24900'
				});

			}
	});
	
}
/*
评论、赞、转发
 */
function focusNumber(){
		$.get(
		  API_URL+"agentinfo/findagentinfo?openid="+openid,
		  function(Obj){
		  	var myData = Obj.basedata;
			$(".talk em").text("("+myData.comment_count+")");
			$(".share em").text("("+myData.forward_count+")");
			$(".well em").text("("+myData.praise_count+")");
		  });
}

$(function(){
	personInfo();
	focusNumber();
	teacherType();
    var listType ="";
	//我关注的讲师默认查品牌
	$(".focus_teacher").attr("href","focus_person.html?openid="+openid+'&type=2&user_status='+user_status);
	//我的主页
	$(".my_page").attr("href","personal_page.html?openid="+openid+"&currentopenid="+openid+'&user_status='+user_status);
	//我关注的讲师
    $(".focus_teacher").attr("href","focus_person.html?openid="+openid+"&currentopenid="+openid+'&user_status='+user_status+"&listType=focus_teacher");
    //我投票的讲师
    $(".voate_teacher").attr("href","focus_person.html?openid="+openid+"&currentopenid="+openid+'&user_status='+user_status+"&listType=voate_teacher");
    //我的粉丝
    $(".my_fans").attr("href","focus_person.html?openid="+openid+"&currentopenid="+openid+'&user_status='+user_status+"&listType=focus_me");

    //评论
	$(".talk").attr("href","participate_items.html?openid="+openid+"&user_status="+user_status+"&type=1");
	//转发
	$(".share").attr("href","participate_items.html?openid="+openid+"&user_status="+user_status+"&type=2");
	//赞
	$(".well").attr("href","participate_items.html?openid="+openid+"&user_status="+user_status+"&type=3");
	
});